from django.http import HttpRequest
from django.utils.deprecation import MiddlewareMixin


class CvPigFilter(MiddlewareMixin):
    @staticmethod
    def process_request(request: HttpRequest):
        # ToDo:正式使用
        # if request.COOKIES.get('username').encode('latin-1').decode('utf-8') is not None:
        #     pass
        # else:
        #     return UnSureJsonResponse(Result.fail(code=2001, message="用户未登录", data=None))
        # ToDo：开发调试
        # request.COOKIES.setdefault('username', 'focus'.encode('utf-8').decode('latin-1'))
        pass
